package com.study.listener;

import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.core.QueueBuilder;
import org.springframework.amqp.rabbit.annotation.Argument;
import org.springframework.amqp.rabbit.annotation.Queue;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Slf4j
@Configuration
public class LazyListener {

    @RabbitListener(queuesToDeclare = @Queue(
            name = "lazy.queue",
            durable = "true",
            arguments = {
                    @Argument(name = "x-queue-mode", value = "lazy")  // ✅ 正确参数
            }
    ))
    public void listenLazyQueue(String msg) {
        log.info("接收到 lazy.queue 的消息: {}", msg);
    }
}
